import React, { useState } from 'react';
import '../../styles/News/RentOut.scss'
const RentOut = (props) => {
  const [index] = useState(props.to.location.state.i)
  const [rentlist] = useState(props.to.location.state.chatinfo[index].rentOut)
  return (
    <div className='RentOut'>
      {rentlist.map((v, i) => {
        return <li className='information-item' key={i} onClick={
          () => {
            document.querySelector('footer').style.display = 'flex'
            props.to.history.push({ pathname: '/rentlist', state: { i } })
          }
        }>
          <img src={v.rent_img} alt="" />
          <div className="information-item-content">
            <h3>{v.name}</h3>
            <p>{v.intro}<span className='price'>￥{v.price}</span></p>
            <p>{v.address}</p>
            <div className="intro">
              <b>集中公寓</b>
              <b>一室一厅</b>
            </div>
          </div>
        </li>

      })}

    </div>
  );
}

export default RentOut;
